package com.sxt.sys.service.impl;

import com.sxt.sys.domain.Role;
import com.sxt.sys.mapper.RoleMapper;
import com.sxt.sys.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 老雷
 * @since 2019-09-24
 */
@Service
@Transactional
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

	

	/**
	 * 根据角色ID查询当前角色拥有的所有的权限或菜单ID
	 */
	@Override
	public List<Integer> queryRoleMenuIdsByRid(Integer roleId) {
		return this.getBaseMapper().queryRoleMenuIdsByRid(roleId);
	}


	/**
	 * 查询当前用户拥有的角色ID集合
	 */
	@Override
	public List<Integer> queryUserRoleIdsByUid(Integer id) {
		return this.getBaseMapper().queryUserRoleIdsByUid(id);
	}
}
